<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>居中</title>
        <style>
            .child{
                position: fixed;
                width: 200px;
                height: 150px;
                background: blue;
                top:50%;
                left: 50%;
                margin-top: -75px;
                margin-left:-100px ;

            }
        </style>
    </head>
    <body>
         <div class="child"></div>
    </body>
</html>
